//
//  MantisTextCellData.m
//  NLProjectFrameworkDemo
//
//  Created by iosdeveloper on 2020/4/23.
//  Copyright © 2020 yj_zhang. All rights reserved.
//

#import "MantisTextCellData.h"

@implementation MantisTextCellData
-(CGSize)contentSize{
    NSString*contentStr=self.isHasEmoji?self.contentRichStr:self.content;
 
    CGRect rect = [contentStr boundingRectWithSize:CGSizeMake(IMSCREEN_WIDTH-leftSpaceMargin-rightSpaceMargin, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName :KIMFontRegularSize(16)} context:nil];

    CGSize size = CGSizeMake(ceilf(rect.size.width)+1, ceilf(rect.size.height));
   
    CGFloat orgiWidth=size.width;
    CGFloat orgHeight=size.height;
    if (orgiWidth<40) {
        orgiWidth=40;//cell最低高度
    }

    if (orgHeight<40) {
        orgHeight=40;//cell最小宽度
    }
    
    CGSize newSize =CGSizeMake(orgiWidth, orgHeight);
    return newSize;
}



@end



